package com.D5Power.Editor.Shower
{
	import com.D5Power.Editor.EditorScene;
	
	import flash.display.BitmapData;
	import flash.geom.Point;
	import flash.geom.Rectangle;

	/**
	 * 各种附加显示器的基类
	 */ 
	public class BaseShower
	{
		/**
		 * 主场景
		 */ 
		protected var _scene:EditorScene;
		
		/**
		 * 主缓冲
		 */ 
		protected var _buffer:BitmapData;
		
		protected var _drawRect:Rectangle;
		
		public function BaseShower(scene:EditorScene)
		{
			_scene = scene;
			_buffer = new BitmapData(Global.MAPSIZE.x,Global.MAPSIZE.y,true,0x00000000);
		}
		
		/**
		 * 缓冲区
		 */ 
		public function get buffer():BitmapData
		{
			return _buffer;
		}
		
		public function render():void
		{
			_drawRect = _scene.Map.cameraView;
			_scene.doubleBuffer.copyPixels(_buffer,_drawRect,new Point(),_buffer,new Point(_drawRect.x,_drawRect.y),true);
		}
	}
}